<?php

class CommentaireTable extends Doctrine_Table
{
	public function updateComment($valeur){
		$q = Doctrine_Query::create()
		  -> update('commentaire')
		  -> set('etat','1')
		  -> where('id =?', $valeur);
		  
		return $q->execute();
	}
	
	public function getCommentByArticle($idarticle,$etat){
		$q = Doctrine_Query::create()
		  -> select('c.*')
		  -> from('commentaire c')
		  -> where('c.articleid=?', intval($idarticle))
		  -> andWhere('c.etat =?', intval($etat));
		  
		  return $q->execute();
	}
}